<?php
	// Resources
	echo '<div class="resources_title"> Resources </div>';
	$courses = $this->MLecturers->getAllCourses();
	if ( count($courses) )
	{
		foreach ( $courses as $key => $course )
		{
			$course_lower = strtolower($course['title']);
			$course_slug = str_replace(" ", "-", $course_lower);
			echo '<div class="resources_link">';
				echo anchor("courses/details/".$course_slug, $course['title'],array('onclick'=>'showurl('.base_url().')'));
			echo '</div>';
		}
	}
	
	// Lecturers
	echo '<div class="lecturers_title"> Lecturers </div>';
	$lecturers = $this->MLecturers->getAllLecturers();
	if ( count($lecturers) )
	{
		foreach ( $lecturers as $key => $lecturer )
		{
			$username = $lecturer['username'];
			$lecturer_name = 'Lec. '.$lecturer['lastname'].' '.$lecturer['firstname'];
			
			echo '<div class="resources_link">';
				echo anchor("lecturers/profile/".$username, $lecturer_name,array('onclick'=>'showurl('.base_url().')'));
			echo '</div>';
		}
	}
?>